-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Country coder #298
Merged
Merged
Country coder #298
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This lets us refer to them in `includeLocations`/`excludeLocations` by their filename
Also sort all the files so the keys and array values are consistent
(they didn't get rolled into the previous updates because they weren't using the circular geojson geometries)
This snaps it to the points that country-coder uses for the UK boundary (re: #297)
Also removes some geojson files that were like this.
- `isValidLocation` returns quickly - `locationToFeature` - actually generates point buffers for point locations - uses countrycoder.aggregrateFeature to get full geometry
We use this for sorting them
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #291
I've been working on this for a few days - this removes a lot of the .geojson files and instead leverages country-coder, iD's new dataset for world region and country boundaries.
This is a breaking change but it lets us significantly reduce the footprint of this library. Every .geojson file for a country or larger region (like Africa, or Latam) can go away. I'm also supporting point locations and we can calculate the 25km circular buffer around them (so all those YouthMappers geometries can go away too).
The main difference is replacing the
featureId
property withincludeLocations
andexcludeLocations
properties to better define where resources are active.Before:
featureId
- (optional) A unique identifier for the feature. ThisfeatureId
matches the resource to a .geojson feature. If null, this is a global resource.After:
includeLocations
- (required) Array of locations where the resource is active. May contain any of these:Example:
"de"
.geojson
files saved under the/features
folderExample:
"de-hamburg.geojson"
[longitude, latitude]
coordinate pairs. A 25km radius circle will be computed around the point.Example:
[8.67039, 49.41882]
excludeLocations
- (optional) Array of locations to exclude fromincludeLocations
(specified in the same format):I'd still like to add some more convenience functions for downstream use, and tests for that. But it's coming along really well.
Before:
After (I can shrink combined a bunch still):